Spot-On
spot-on-neighbor.h
1 /*
2 ** Copyright (c) 2011 - 10^10^10, Alexis Megas.
3 ** All rights reserved.
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 ** 1. Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** 3. The name of the author may not be used to endorse or promote products
14 ** derived from Spot-On without specific prior written permission.
15 **
16 ** SPOT-ON IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 ** SPOT-ON, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef _spoton_neighbor_h_
29 #define _spoton_neighbor_h_
30 
31 #include <QAtomicInt>
32 #include <QDateTime>
33 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) && !defined(SPOTON_DTLS_DISABLED)
34 #include <QDtls>
35 #include <QDtlsClientVerifier>
36 #endif
37 #include <QFuture>
38 #include <QHostAddress>
39 #include <QHostInfo>
40 #include <QMap>
41 #include <QNetworkProxy>
42 #include <QPointer>
43 #include <QReadWriteLock>
44 #include <QSqlDatabase>
45 #include <QSslSocket>
46 #include <QThread>
47 #include <QTimer>
48 #include <QUdpSocket>
49 #include <QUuid>
50 #if QT_VERSION >= 0x050300 && defined(SPOTON_WEBSOCKETS_ENABLED)
51 #include <QWebSocket>
52 #endif
53 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
54 #ifndef Q_OS_MACOS
55 #include <qbluetoothservicediscoveryagent.h>
56 #endif
57 #include <qbluetoothsocket.h>
58 #endif
59 
60 #include "Common/spot-on-common.h"
61 #include "Common/spot-on-crypt.h"
62 #include "Common/spot-on-external-address.h"
63 #include "Common/spot-on-misc.h"
64 #include "Common/spot-on-send.h"
65 #include "Common/spot-on-socket-options.h"
66 #include "spot-on-sctp-socket.h"
67 
68 class spoton_neighbor_tcp_socket: public QSslSocket
69 {
70  Q_OBJECT
71 
72  public:
73  spoton_neighbor_tcp_socket(QObject *parent = 0):QSslSocket(parent)
74  {
75  }
76 
77  void setLocalAddress(const QHostAddress &address)
78  {
79  QSslSocket::setLocalAddress(address);
80  }
81 };
82 
83 class spoton_neighbor_udp_socket: public QUdpSocket
84 {
85  Q_OBJECT
86 
87  public:
88  spoton_neighbor_udp_socket(QObject *parent = 0):QUdpSocket(parent)
89  {
90  m_multicastSocket = 0;
91  }
92 
93  void initializeMulticast(const QHostAddress &address,
94  const quint16 port,
95  const QString &socketOptions)
96  {
97  if(address.protocol() == QAbstractSocket::IPv4Protocol)
98  {
99  quint32 a = address.toIPv4Address();
100 
101  if(!((a & 0xf0000000) == 0xe0000000))
102  return;
103  }
104  else if(address.protocol() == QAbstractSocket::IPv6Protocol)
105  {
106  Q_IPV6ADDR a6 = address.toIPv6Address();
107 
108  if(a6.c[0] != 0xff)
109  return;
110  }
111  else
112  return;
113 
114  if(m_multicastSocket)
115  m_multicastSocket->deleteLater();
116 
117  m_multicastSocket = new QUdpSocket(this);
118 
119  if(!m_multicastSocket->bind(address,
120  port,
121  QUdpSocket::ReuseAddressHint |
122  QUdpSocket::ShareAddress))
123  {
124  m_multicastSocket->deleteLater();
125  spoton_misc::logError
126  (QString("spoton_neighbor_udp_socket::initializeMulticast(): "
127  "bind() failure for %1:%2.").
128  arg(address.toString()).arg(port));
129  return;
130  }
131 
132  spoton_socket_options::setSocketOptions
133  (socketOptions,
134  "udp",
135  static_cast<qint64> (m_multicastSocket->socketDescriptor()),
136  0);
137 
138  if(!m_multicastSocket->joinMulticastGroup(address))
139  {
140  m_multicastSocket->deleteLater();
141  spoton_misc::logError
142  (QString("spoton_neighbor_udp_socket::initializeMulticast(): "
143  "joinMulticastGroup() failure for %1:%2.").
144  arg(address.toString()).arg(port));
145  }
146  else
147  m_multicastSocket->setSocketOption
148  (QAbstractSocket::MulticastLoopbackOption, 1);
149  }
150 
151  QPointer<QUdpSocket> multicastSocket(void) const
152  {
153  return m_multicastSocket;
154  }
155 
156  void setLocalAddress(const QHostAddress &address)
157  {
158  QUdpSocket::setLocalAddress(address);
159  }
160 
161  void setLocalPort(quint16 port)
162  {
163  QUdpSocket::setLocalPort(port);
164  }
165 
166  void setPeerAddress(const QHostAddress &address)
167  {
168  QUdpSocket::setPeerAddress(address);
169  }
170 
171  void setPeerPort(quint16 port)
172  {
173  QUdpSocket::setPeerPort(port);
174  }
175 
176  private:
177  QPointer<QUdpSocket> m_multicastSocket;
178 };
179 
180 class spoton_neighbor: public QThread
181 {
182  Q_OBJECT
183 
184  public:
185  spoton_neighbor(void)
186  {
187  }
188 
189  spoton_neighbor(const QNetworkProxy &proxy,
190  const QString &ipAddress,
191  const QString &port,
192  const QString &scopeId,
193  const qint64 id,
194  const bool userDefined,
195  const int keySize,
196  const qint64 maximumBufferSize,
197  const qint64 maximumContentLength,
198  const QString &echoMode,
199  const QByteArray &peerCertificate,
200  const bool allowExceptions,
201  const QString &protocol,
202  const bool requireSsl,
203  const QByteArray &accountName,
204  const QByteArray &accountPassword,
205  const QString &transport,
206  const QString &orientation,
207  const QString &motd,
208  const QString &statusControl,
209  const QString &sslControlString,
210  const Priority priority,
211  const int laneWidth,
212  const int passthrough,
213  const int waitforbyteswritten_msecs,
214  const QByteArray &privateApplicationCredentials,
215  const int silenceTime,
216  const QString &socketOptions,
217  const QString &bindIpAddress,
218  QObject *parent);
219 
220  /*
221  ** We're a server. Let's represent a client connection.
222  */
223 
224  spoton_neighbor(const qintptr socketDescriptor,
225  const QByteArray &certificate,
226  const QByteArray &privateKey,
227  const QString &echoMode,
228  const bool useAccounts,
229  const qint64 listenerOid,
230  const qint64 maximumBufferSize,
231  const qint64 maximumContentLength,
232  const QString &transport,
233  const QString &ipAddress,
234  const QString &port,
235  const QString &localIpAddress,
236  const QString &localPort,
237  const QString &orientation,
238  const QString &motd,
239  const QString &sslControlString,
240  const Priority priority,
241  const int laneWidth,
242  const int passthrough,
243  const int sourceOfRandomness,
244  const QByteArray &privateApplicationCredentials,
245 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
246  QBluetoothSocket *bluetooth_socket,
247 #endif
248 #if QT_VERSION >= 0x050300 && defined(SPOTON_WEBSOCKETS_ENABLED)
249  QWebSocket *web_socket,
250 #endif
251  const int keySize,
252  QObject *parent);
253  ~spoton_neighbor();
254  QAbstractSocket::SocketState state(void) const;
255  QString localAddress(void) const;
256  QString peerAddress(void) const;
257 
258  QString scopeId(void) const
259  {
260  return m_scopeId;
261  }
262 
263  QString transport(void) const;
264  QUuid receivedUuid(void);
265  bool isEncrypted(void) const;
266  bool readyToWrite(void) const;
267  bool writeMessage006X(const QByteArray &data, const QString &messageType);
268  int write(const char *data, const int size, const bool emitDropped = true);
269  qint64 id(void) const;
270  quint16 peerPort(void) const;
271  void abort(void);
272  void close(void);
273  void processData(void);
274  void setId(const qint64 id);
275 
276  private:
277  QAtomicInt m_abort;
278  QAtomicInt m_kernelInterfaces;
279  QAtomicInt m_passthrough;
280  QAtomicInt m_waitforbyteswritten_msecs;
281  QByteArray m_accountClientSentSalt;
282  QByteArray m_accountName;
283  QByteArray m_accountPassword;
284  QByteArray m_data;
285  QByteArray m_privateApplicationCredentials;
286  QDateTime m_lastReadTime;
287  QDateTime m_startTime;
288 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) && !defined(SPOTON_DTLS_DISABLED)
289  QDtlsClientVerifier m_dtlsClientVerifier;
290  QHash<QPair<QHostAddress, quint16>, char> m_verifiedUdpClients;
291 #endif
292  QList<QFuture<void> > m_privateApplicationFutures;
293  QList<QPair<QByteArray, QByteArray> > m_learnedAdaptiveEchoPairs;
294  QMap<quint64, QByteArray> m_privateApplicationMap;
295  QMutex m_privateApplicationMutex;
296  QPair<QByteArray, QByteArray> m_adaptiveEchoPair;
297  QPair<quint64, quint64> m_privateApplicationSequences;
298 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
299 #ifndef Q_OS_MACOS
300  QPointer<QBluetoothServiceDiscoveryAgent> m_bluetoothServiceDiscoveryAgent;
301 #endif
302  QPointer<QBluetoothSocket> m_bluetoothSocket;
303 #else
304  QPointer<QObject> m_bluetoothSocket;
305 #endif
306 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) && !defined(SPOTON_DTLS_DISABLED)
307  QPointer<QDtls> m_dtls;
308 #endif
309 #if QT_VERSION >= 0x050300 && defined(SPOTON_WEBSOCKETS_ENABLED)
310  QPointer<QWebSocket> m_webSocket;
311 #else
312  QPointer<QObject> m_webSocket;
313 #endif
314  QPointer<spoton_external_address> m_externalAddress;
315  QPointer<spoton_neighbor_tcp_socket> m_tcpSocket;
316  QPointer<spoton_neighbor_udp_socket> m_udpSocket;
317  QPointer<spoton_sctp_socket> m_sctpSocket;
318  QReadWriteLock m_accountClientSentSaltMutex;
319  QReadWriteLock m_accountNameMutex;
320  QReadWriteLock m_accountPasswordMutex;
321  QReadWriteLock m_bytesDiscardedOnWriteMutex;
322  QReadWriteLock m_bytesWrittenMutex;
323  QReadWriteLock m_dataMutex;
324  QReadWriteLock m_echoModeMutex;
325  QReadWriteLock m_learnedAdaptiveEchoPairsMutex;
326  QReadWriteLock m_maximumBufferSizeMutex;
327  QReadWriteLock m_maximumContentLengthMutex;
328  QReadWriteLock m_receivedUuidMutex;
329  QSslCertificate m_peerCertificate;
330 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) && !defined(SPOTON_DTLS_DISABLED)
331  QSslConfiguration m_udpSslConfiguration;
332 #endif
333  QString m_address;
334  QString m_bindIpAddress;
335  QString m_echoMode;
336  QString m_ipAddress;
337  QString m_motd;
338  QString m_orientation;
339  QString m_protocol;
340  QString m_scopeId;
341  QString m_socketOptions;
342  QString m_sslControlString;
343  QString m_statusControl;
344  QString m_transport;
345  QTimer m_accountTimer;
346  QTimer m_authenticationTimer;
347  QTimer m_externalAddressDiscovererTimer;
348  QTimer m_keepAliveTimer;
349  QTimer m_lifetime;
350  QTimer m_specialPeerTimer; // Server-less.
351  QTimer m_timer;
352  QUuid m_receivedUuid;
353  bool m_allowExceptions;
354  bool m_isUserDefined;
355  bool m_requireSsl;
356  bool m_useSsl;
357  int m_keySize;
358  int m_laneWidth;
359  int m_silenceTime;
360  int m_sourceOfRandomness;
361  mutable QAtomicInt m_accountAuthenticated;
362  mutable QAtomicInt m_useAccounts;
363  qint64 m_id;
364  qint64 m_listenerOid;
365  qint64 m_maximumBufferSize;
366  qint64 m_maximumContentLength;
367  quint16 m_port;
368  quint64 m_bytesDiscardedOnWrite;
369  quint64 m_bytesRead;
370  quint64 m_bytesWritten;
371  QSslConfiguration sslConfiguration(void) const;
372  QString findMessageType
373  (const QByteArray &data,
374  QList<QByteArray> &symmetricKeys,
375  QPair<QByteArray, QByteArray> &discoveredAdaptiveEchoPair);
376  void addToBytesWritten(const qint64 bytesWritten);
377  void bundlePrivateApplicationData
378  (const QByteArray &data,
379  const QByteArray &privateApplicationCredentials,
380  const qint64 id,
381  const quint64 sequence);
382  void parsePrivateApplicationData
383  (const QByteArray &data,
384  const QByteArray &privateApplicationCredentials,
385  const qint64 maximumContentLength);
386 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) && !defined(SPOTON_DTLS_DISABLED)
387  void prepareDtls(void);
388 #endif
389  void prepareSslConfiguration(const QByteArray &certificate,
390  const QByteArray &privateKey,
391  const bool client);
392  void process0000(int length,
393  const QByteArray &data,
394  const QList<QByteArray> &symmetricKeys);
395  void process0000a(int length,
396  const QByteArray &data,
397  const QString &messageType);
398  void process0000b(int length,
399  const QByteArray &data,
400  const QList<QByteArray> &symmetricKeys);
401  void process0000d(int length,
402  const QByteArray &data,
403  const QList<QByteArray> &symmetricKeys);
404  void process0001a(int length, const QByteArray &data);
405  void process0001b(int length,
406  const QByteArray &data,
407  const QList<QByteArray> &symmetricKeys);
408  void process0001c(int length,
409  const QByteArray &data,
410  const QList<QByteArray> &symmetricKeys);
411  void process0002a(int length,
412  const QByteArray &data,
413  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
414  void process0002b(int length,
415  const QByteArray &data,
416  const QList<QByteArray> &symmetricKeys,
417  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
418  void process0011(int length, const QByteArray &data);
419  void process0012(int length, const QByteArray &data);
420  void process0013(int length,
421  const QByteArray &data,
422  const QList<QByteArray> &symmetricKeys);
423  void process0014(int length, const QByteArray &data);
424  void process0030(int length, const QByteArray &data);
425  void process0040a(int length,
426  const QByteArray &data,
427  const QList<QByteArray> &symmetricKeys);
428  void process0040b(int length,
429  const QByteArray &data,
430  const QList<QByteArray> &symmetricKeys);
431  void process0050(int length, const QByteArray &data);
432  void process0051(int length, const QByteArray &data);
433  void process0065(int length, const QByteArray &data);
434  void process0070(int length, const QByteArray &data);
435  void process0080(int length,
436  const QByteArray &data,
437  const QList<QByteArray> &symmetricKeys);
438  void process0090(int length,
439  const QByteArray &data,
440  const QList<QByteArray> &symmetricKeys);
441  void process0091a(int length,
442  const QByteArray &data,
443  const QList<QByteArray> &symmetricKeys);
444  void process0091b(int length,
445  const QByteArray &data,
446  const QList<QByteArray> &symmetricKeys);
447  void process0092(int length,
448  const QByteArray &data,
449  const QList<QByteArray> &symmetricKeys);
450  void process0095a(int length, const QByteArray &data);
451  void process0095b(int length, const QByteArray &data);
452  void readyRead(const QByteArray &data);
453  void recordCertificateOrAbort(void);
454  void run(void);
455  void saveExternalAddress(const QHostAddress &address,
456  const QSqlDatabase &db);
457  void saveGemini(const QByteArray &publicKeyHash,
458  const QByteArray &gemini,
459  const QByteArray &geminiHashKey,
460  const QByteArray &timestamp,
461  const QByteArray &signature,
462  const QString &messageType);
463  void saveParticipantStatus(const QByteArray &publicKeyHash);
464  void saveParticipantStatus(const QByteArray &name,
465  const QByteArray &publicKeyHash);
466  void saveParticipantStatus(const QByteArray &name,
467  const QByteArray &publicKeyHash,
468  const QByteArray &status,
469  const QByteArray &timestamp);
470  void savePublicKey(const QByteArray &keyType,
471  const QByteArray &name,
472  const QByteArray &publicKey,
473  const QByteArray &signature,
474  const QByteArray &sPublicKey,
475  const QByteArray &sSignature,
476  const qint64 neighbor_oid,
477  const bool ignore_key_permissions,
478  const bool signatures_required,
479  const QString &messageType);
480  void saveStatistics(const QSqlDatabase &db);
481  void saveStatus(const QSqlDatabase &db, const QString &status);
482  void saveStatus(const QString &status);
483  void saveUrlsToShared(const QList<QByteArray> &urls);
484  void storeLetter(const QByteArray &symmetricKey,
485  const QByteArray &symmetricKeyAlgorithm,
486  const QByteArray &hashKey,
487  const QByteArray &hashKeyAlgorithm,
488  const QByteArray &senderPublicKeyHash,
489  const QByteArray &name,
490  const QByteArray &subject,
491  const QByteArray &message,
492  const QByteArray &date,
493  const QByteArray &attachmentData,
494  const QByteArray &signature,
495  const bool goldbugUsed);
496  void storeLetter(const QList<QByteArray> &list,
497  const QByteArray &recipientHash);
498 
499  private slots:
500  void slotAccountAuthenticated(const QByteArray &clientSalt,
501  const QByteArray &name,
502  const QByteArray &password);
503  void slotAuthenticationTimerTimeout(void);
504  void slotBinaryFrameReceived(const QByteArray &fame, bool isLastFrame);
505  void slotBinaryMessageReceived(const QByteArray &message);
506  void slotCallParticipant(const QByteArray &data, const QString &messageType);
507  void slotConnected(void);
508  void slotDisconnected(void);
509  void slotDiscoverExternalAddress(void);
510  void slotEchoKeyShare(const QByteArrayList &list);
511  void slotEncrypted(void);
512  void slotError(QAbstractSocket::SocketError error);
513 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
514  void slotError(QBluetoothSocket::SocketError error);
515 #endif
516  void slotError(const QString &method,
517  const spoton_sctp_socket::SocketError error);
518  void slotExternalAddressDiscovered(const QHostAddress &address);
519  void slotHandshakeTimeout(void);
520  void slotHostFound(const QHostInfo &hostInfo);
521  void slotInitiateSSLTLSSession(const bool client, const qint64 oid);
522  void slotLifetimeExpired(void);
523  void slotModeChanged(QSslSocket::SslMode mode);
524  void slotNewDatagram(const QByteArray &datagram,
525  const QHostAddress &address,
526  const quint16 port);
527  void slotPeerVerifyError(const QSslError &error);
528  void slotProxyAuthenticationRequired(const QNetworkProxy &proxy,
529  QAuthenticator *authenticator);
530 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
531  void slotPublicizeListenerPlaintext(const QBluetoothAddress &address,
532  const quint16 port,
533  const QString &orientation);
534 #endif
535  void slotPublicizeListenerPlaintext(const QByteArray &data,
536  const qint64 id);
537  void slotPublicizeListenerPlaintext(const QHostAddress &address,
538  const quint16 port,
539  const QString &transport,
540  const QString &orientation);
541  void slotReadyRead(void);
542  void slotResetKeepAlive(void);
543  void slotRetrieveMail(const QByteArrayList &list,
544  const QString &messageType);
545  void slotSMPMessageReceivedFromUI(const QByteArrayList &list);
546  void slotSendAccountInformation(void);
547  void slotSendAuthenticationRequest(void);
548  void slotSendBuzz(const QByteArray &data);
549  void slotSendCapabilities(void);
550  void slotSendForwardSecrecyPublicKey(const QByteArray &data);
551  void slotSendForwardSecrecySessionKeys(const QByteArray &data);
552  void slotSendMOTD(void);
553  void slotSendMail(const QPairByteArrayInt64List &list,
554  const QString &messageType);
555  void slotSendMailFromPostOffice
556  (const QByteArray &data, const QPairByteArrayByteArray &adaptiveEchoPair);
557  void slotSendMessage(const QByteArray &data,
558  const spoton_send::spoton_send_method sendMethod);
559  void slotSendStatus(const QByteArrayList &list);
560  void slotSpecialTimerTimeout(void);
561  void slotSslErrors(const QList<QSslError> &errors);
562  void slotStopTimer(QTimer *timer);
563  void slotTimeout(void);
564  void slotWrite(const QByteArray &data,
565  const qint64 id,
566  const QPairByteArrayByteArray &adaptiveEchoPair);
567  void slotWriteParsedApplicationData(const QByteArray &data);
568  void slotWriteURLs(const QByteArray &data);
569 
570  public slots:
571  void deleteLater(void);
572  void slotSharePublicKey(const QByteArray &keyType,
573  const QByteArray &name,
574  const QByteArray &publicKey,
575  const QByteArray &signature,
576  const QByteArray &sPublicKey,
577  const QByteArray &sSignature);
578 
579  signals:
580  void accountAuthenticated(const QByteArray &clientSalt,
581  const QByteArray &name,
582  const QByteArray &password);
583  void authenticationRequested(const QString &peerInformation);
584 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
585  void bluetooth(const QBluetoothServiceInfo &serviceInfo);
586 #endif
587  void bytesReceived(const qint64 size);
588  void bytesSent(const qint64 size);
589  void callParticipant(const QByteArray &publicKeyHash,
590  const QByteArray &gemini,
591  const QByteArray &geminiHashKey);
592  void disconnected(void);
593  void dropped(const QByteArray &data);
594  void forwardSecrecyRequest(const QByteArrayList &list);
595  void newData(void);
596  void newEMailArrived(void);
597  void notification(const QString &text);
598  void publicizeListenerPlaintext(const QByteArray &data, const qint64 id);
599  void receivedBuzzMessage(const QByteArrayList &list,
600  const QByteArrayList &symmetricKeys);
601  void receivedChatMessage(const QByteArray &data);
602  void receivedMessage
603  (const QByteArray &data,
604  const qint64 id,
605  const QPairByteArrayByteArray &adaptiveEchoPair);
606  void receivedPublicKey(const QByteArray &name, const QByteArray publicKey);
607  void resetKeepAlive(void);
608  void retrieveMail(const QByteArray &data,
609  const QByteArray &publicKeyHash,
610  const QByteArray &timestamp,
611  const QByteArray &signature,
612  const QPairByteArrayByteArray &adaptiveEchoPair);
613  void saveForwardSecrecySessionKeys(const QByteArrayList &list);
614  void scrambleRequest(void);
615  void sharePublicKey(const QByteArray &keyType,
616  const QByteArray &name,
617  const QByteArray &publicKey,
618  const QByteArray &signature,
619  const QByteArray &sPublicKey,
620  const QByteArray &sSignature);
621  void smpMessage(const QByteArrayList &list);
622  void statusMessageReceived(const QByteArray &publicKeyHash,
623  const QString &status);
624  void stopTimer(QTimer *timer);
625  void writeParsedApplicationData(const QByteArray &data);
626 };
627 
628 class spoton_neighbor_worker: public QObject
629 {
630  Q_OBJECT
631 
632  public:
633  spoton_neighbor_worker(spoton_neighbor *neighbor):QObject(0)
634  {
635  m_neighbor = neighbor;
636  }
637 
639  {
640  }
641 
642  private:
643  QPointer<spoton_neighbor> m_neighbor;
644 
645  private slots:
646  void slotNewData(void)
647  {
648  if(m_neighbor)
649  m_neighbor->processData();
650  }
651 };
652 #endif
spoton_neighbor_tcp_socket
Definition: spot-on-neighbor.h:68
spoton_neighbor
Definition: spot-on-neighbor.h:180
spoton_neighbor_udp_socket
Definition: spot-on-neighbor.h:83
spoton_neighbor_worker
Definition: spot-on-neighbor.h:628